home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00015_Script_Texto Drag
< prev
next >
Wrap
Text File
|
1999-03-19
|
2KB
|
55 lines
property spr, mem
property interessados
property linhaAtual, linhaMax
property numLinhas
property alturaLinha, linhasJanela
on getPropertyDescriptionList
set p_list = [ ¼
#interessados: [ #comment: "Sprites que se interessam pelo scroll:", ¼
#format: #list, ¼
#default: [] ] ¼
]
return p_list
end
on beginSprite me
set spr = the spriteNum of me
set mem = the member of sprite spr
set linhaAtual = 1
set numLinhas = the lineCount of member mem
set alturaLinha = lineheight(mem, 1)
set linhasJanela = the height of sprite spr / alturaLinha
set linhaMax = numLinhas - alturaLinha/2
if linhaMax < 1 then set linhaMax = 1
end
on mouseDown me
set y_ini = the mouseV
set linha_ini = linhaAtual
global gCritico, gMustUpdate
set gCritico = gCritico + 1
repeat while the mouseDown
set gMustUpdate = false
sendAllSprites(#idleSprite)
set y = the mouseV
set l = - (y - y_ini) / alturaLinha + linha_ini
if l < 1 then
set l = 1
else if l > linhaMax then
set l = linhaMax
end if
if l <> linhaAtual then
scrollByLine member mem, l-linhaAtual
set gMustUpdate = true
if count(interessados) > 0 then
repeat with i = 1 to count(interessados)
sendSprite(getAt(interessados,i), #scrollLinha, l - linhaAtual)
end repeat
end if
set linhaAtual = l
end if
if gMustUpdate then updateStage
end repeat
set gCritico = gCritico -1
end